package com.neusoft.elm.service;

import com.neusoft.elm.dao.CartDao;
import com.neusoft.elm.po.Cart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartDao cartDao;
    @Override
    public List<Cart> listCart(Cart cart) throws Exception {
        List<Cart>list=cartDao.listCart(cart);
        return list;
    }
@Transactional(rollbackFor = Exception.class)
    @Override
    public int saveCart(Cart cart) throws Exception {
        int i = cartDao.saveCart(cart);
        return i;
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int removeCart(Cart cart) throws Exception {
        int i = cartDao.removeCart(cart);
        return i;
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateCart(Cart cart) throws Exception {
        int i = cartDao.updateCart(cart);
        return i;
    }
}
